#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	int n, a, b, c;
	cin >> n >> a >> b >> c;
	int ret = 0;
	ret += n / a;
	n %= a;
	
	ret += n / b;
	n %= b;
	
	ret += n / c;
	n %= c;
	
	cout << ret << endl;
	return 0;
}
